package org.main.userprovider.Dao;

import org.main.bean.POJO.PAddress;
import org.main.bean.entity.User;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

public interface PAddressDao extends JpaRepository<PAddress,Integer> {

    /*
    *根据用户ID查询地址
    * */
    @Query(value = "select * from address where userId=:userId",nativeQuery = true)
    public List<PAddress> getAlls(@Param("userId") int userId);

}
